---------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\Users\sbstjp\OneDrive - Cardiff University\FinalHarvard\Appendix2.8.log
  log type:  text
 opened on:  12 May 2025, 16:53:20

. set maxvar 30000


. use "C:\Users\sbstjp\OneDrive - Cardiff University\BES2024_W29_Panel_v29.1.dta" // Fieldhouse, E., J. Green, 
> G. Evans, J. Mellon, C. Prosser, J. Bailey, R. de Geus, H. Schmitt, C. van der Eijk, J. Griffiths, & S. Perre
> tt. (2024) British Election Study Internet Panel Waves 1-29. DOI: 10.5255/UKDA-SN-8202-2// Accessed on March 
> 11 2025.

. 
. // Social justice scale
. * Clean "don't know" responses 
. foreach var in cwTransW26W27 cwAuthorsW26W27 cwLanguageW26W27 cwTrainingW26W27 {
  2.     replace `var' = . if `var' == 9999
  3. }
(3,037 real changes made, 3,037 to missing)
(2,498 real changes made, 2,498 to missing)
(1,088 real changes made, 1,088 to missing)
(3,338 real changes made, 3,338 to missing)

. 
. *Reverse variable so social justice coded high
. foreach var in cwLanguageW26W27 cwTrainingW26W27 {
  2.     qui sum `var'
  3.     local max_value = r(max)
  4.     gen r`var' = `max_value' + 1 - `var'
  5. }
(87,418 missing values generated)
(89,668 missing values generated)

. 
. *Standardize items in the scale from 1-2 - this avoids 0, for reasons outlined in next step
. foreach var in cwTransW26W27 cwAuthorsW26W27 rcwLanguageW26W27 rcwTrainingW26W27 {
  2.     summarize `var'
  3.     gen s`var' = 1 + (`var' - r(min)) / (r(max) - r(min))
  4. }

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
cwTransW2~27 |     29,358    1.836603    1.124489          1          5
(89,367 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
cwAuthors~27 |     29,897    2.836405    1.122168          1          5
(88,828 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
rcwLangua~27 |     31,307    2.053023    1.102404          1          5
(87,418 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
rcwTraini~27 |     29,057    2.919159    1.286139          1          5
(89,668 missing values generated)

. 
. *At this point, the scale has a Cronbach's Alpha of 0.73
. 
. * Replace missing values with 0 for the specified variables - this is necessary as Stata doesn't add up missi
> ng values and means a 0-1 standardization scale isn't feasible as missing values would overlap with the scale
. foreach var in scwTransW26W27 scwAuthorsW26W27 srcwLanguageW26W27 srcwTrainingW26W27 {
  2.     replace `var' = 0 if missing(`var')
  3. }
(89,367 real changes made)
(88,828 real changes made)
(87,418 real changes made)
(89,668 real changes made)

. 
. * Initialize the total score and the count of non-zero responses
. gen total_scoreSJV = 0

. gen count_nonzeroSJV = 0

. 
. * Add each variable to the total scale score and count it if non-zero
. foreach var in scwTransW26W27 scwAuthorsW26W27 srcwLanguageW26W27 srcwTrainingW26W27 {
  2.     replace total_scoreSJV = total_scoreSJV + `var'
  3.     replace count_nonzeroSJV = count_nonzeroSJV + (`var' != 0)
  4. }
(29,358 real changes made)
(29,358 real changes made)
(29,897 real changes made)
(29,897 real changes made)
(31,307 real changes made)
(31,307 real changes made)
(29,057 real changes made)
(29,057 real changes made)

. 
. * Calculate the average score, avoiding division by zero
. gen SocJusValues = .
(118,725 missing values generated)

. replace SocJusValues = total_scoreSJV / count_nonzeroSJV if count_nonzeroSJV > 0
(31,966 real changes made)

. 
. // Demographics
. * Delete missing values and rename
. replace p_gross_householdW26 = . if inlist(p_gross_householdW26, 16, 17) 
(7,755 real changes made, 7,755 to missing)

. rename gender FemaleGender

. replace leftRightW26=. if leftRightW26==9999
(5,339 real changes made, 5,339 to missing)

. 
. *Generate dummies
. gen SocCulEmployment=.
(118,725 missing values generated)

. replace SocCulEmployment=0 if sectorW26W27W29==1
(13,887 real changes made)

. replace SocCulEmployment=1 if inrange(sectorW26W27W29, 2, 4)
(12,617 real changes made)

. replace SocCulEmployment=0 if inlist(sectorW26W27W29, 5, 8, 9) 
(2,938 real changes made)

. 
. gen MinorityEthnic=. 
(118,725 missing values generated)

. replace MinorityEthnic=0 if inlist(p_ethnicityW26, 1, 2)
(27,507 real changes made)

. replace MinorityEthnic=1 if inrange(p_ethnicityW26, 3, 15)
(2,168 real changes made)

. 
. gen Graduate=.
(118,725 missing values generated)

. replace Graduate=0 if inrange(p_edlevelUniW26, 0, 3)
(14,266 real changes made)

. replace Graduate=1 if inlist(p_edlevelUniW26, 4, 5)
(13,992 real changes made)

. 
. gen Childless=.
(118,725 missing values generated)

. replace Childless=1 if numChildrenW14==0
(11,376 real changes made)

. replace Childless=0 if inrange(numChildrenW14, 1, 6)
(19,209 real changes made)

. 
. *Create interaction terms
. gen FemGenChildlessInteraction = FemaleGender * Childless 
(88,140 missing values generated)

. gen AgeFemGenInteraction = FemaleGender * ageW26
(88,661 missing values generated)

. 
. // Standardize 
. rename Age age1

. egen Age = std(ageW26)
(88,661 missing values generated)

. egen Income = std(p_gross_householdW26)
(96,508 missing values generated)

. 
. // Regressions
. regress SocJusValues Age FemaleGender Graduate Income MinorityEthnic SocCulEmployment [pweight=wt_new_W26], r
> obust 
(sum of wgt is 18,957.4897399269)

Linear regression                               Number of obs     =     19,616
                                                F(6, 19609)       =     378.39
                                                Prob > F          =     0.0000
                                                R-squared         =     0.1442
                                                Root MSE          =     .20557

----------------------------------------------------------------------------------
                 |               Robust
    SocJusValues | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-----------------+----------------------------------------------------------------
             Age |  -.0572596   .0021768   -26.30   0.000    -.0615262    -.052993
    FemaleGender |   .0668229   .0038457    17.38   0.000     .0592851    .0743607
        Graduate |   .0738291   .0039788    18.56   0.000     .0660303    .0816279
          Income |  -.0049703   .0021722    -2.29   0.022    -.0092281   -.0007125
  MinorityEthnic |   .0448077   .0073628     6.09   0.000     .0303759    .0592394
SocCulEmployment |   .0334995   .0039111     8.57   0.000     .0258333    .0411656
           _cons |   1.179927   .0062955   187.42   0.000     1.167588    1.192267
----------------------------------------------------------------------------------

. eststo
(est1 stored)

. regress SocJusValues Age FemaleGender Graduate Income MinorityEthnic SocCulEmployment AgeFemGenInteraction [p
> weight=wt_new_W26], robust
(sum of wgt is 18,957.4897399269)

Linear regression                               Number of obs     =     19,616
                                                F(7, 19608)       =     326.21
                                                Prob > F          =     0.0000
                                                R-squared         =     0.1468
                                                Root MSE          =     .20526

--------------------------------------------------------------------------------------
                     |               Robust
        SocJusValues | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
---------------------+----------------------------------------------------------------
                 Age |  -.0205528   .0065614    -3.13   0.002    -.0334137   -.0076918
        FemaleGender |   .1393258     .01393    10.00   0.000     .1120219    .1666296
            Graduate |   .0735019   .0039745    18.49   0.000     .0657114    .0812923
              Income |  -.0054567   .0021733    -2.51   0.012    -.0097166   -.0011968
      MinorityEthnic |   .0453753   .0073648     6.16   0.000     .0309397    .0598109
    SocCulEmployment |    .033697   .0039117     8.61   0.000     .0260298    .0413643
AgeFemGenInteraction |  -.0014241   .0002283    -6.24   0.000    -.0018716   -.0009767
               _cons |   1.191039   .0056502   210.79   0.000     1.179964    1.202114
--------------------------------------------------------------------------------------

. eststo
(est2 stored)

. regress SocJusValues Age FemaleGender Graduate Income MinorityEthnic SocCulEmployment Childless [pweight=wt_n
> ew_W26], robust 
(sum of wgt is 7,528.97337697429)

Linear regression                               Number of obs     =      8,690
                                                F(7, 8682)        =     104.95
                                                Prob > F          =     0.0000
                                                R-squared         =     0.1255
                                                Root MSE          =     .19706

----------------------------------------------------------------------------------
                 |               Robust
    SocJusValues | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-----------------+----------------------------------------------------------------
             Age |   -.042952   .0039179   -10.96   0.000     -.050632   -.0352719
    FemaleGender |   .0604739    .005602    10.80   0.000     .0494926    .0714552
        Graduate |   .0639619   .0056609    11.30   0.000     .0528651    .0750586
          Income |  -.0024219   .0033231    -0.73   0.466    -.0089359    .0040922
  MinorityEthnic |   .0785347   .0147405     5.33   0.000     .0496398    .1074296
SocCulEmployment |   .0260252   .0056739     4.59   0.000     .0149031    .0371474
       Childless |   .0203256   .0060642     3.35   0.001     .0084383    .0322128
           _cons |   1.182405   .0096961   121.95   0.000     1.163398    1.201411
----------------------------------------------------------------------------------

. eststo
(est3 stored)

. regress SocJusValues Age FemaleGender Graduate Income MinorityEthnic SocCulEmployment Childless FemGenChildle
> ssInteraction [pweight=wt_new_W26], robust 
(sum of wgt is 7,528.97337697429)

Linear regression                               Number of obs     =      8,690
                                                F(8, 8681)        =      94.88
                                                Prob > F          =     0.0000
                                                R-squared         =     0.1256
                                                Root MSE          =     .19705

--------------------------------------------------------------------------------------------
                           |               Robust
              SocJusValues | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
---------------------------+----------------------------------------------------------------
                       Age |  -.0429474   .0039162   -10.97   0.000    -.0506241   -.0352706
              FemaleGender |   .0644329     .00633    10.18   0.000     .0520245    .0768412
                  Graduate |   .0640804   .0056541    11.33   0.000     .0529971    .0751637
                    Income |  -.0022572   .0033319    -0.68   0.498    -.0087884    .0042741
            MinorityEthnic |   .0784751    .014687     5.34   0.000     .0496851    .1072651
          SocCulEmployment |   .0258738     .00566     4.57   0.000     .0147788    .0369688
                 Childless |   .0349335   .0190761     1.83   0.067    -.0024601    .0723271
FemGenChildlessInteraction |  -.0097456   .0115202    -0.85   0.398     -.032328    .0128368
                     _cons |   1.176403   .0109561   107.37   0.000     1.154926    1.197879
--------------------------------------------------------------------------------------------

. eststo
(est4 stored)

. regress SocJusValues Age FemaleGender Graduate Income MinorityEthnic SocCulEmployment [pweight=wt_new_W26] if
>  leftRightW26<5, robust
(sum of wgt is 6,318.31455701467)

Linear regression                               Number of obs     =      7,076
                                                F(6, 7069)        =     176.88
                                                Prob > F          =     0.0000
                                                R-squared         =     0.1611
                                                Root MSE          =     .20559

----------------------------------------------------------------------------------
                 |               Robust
    SocJusValues | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-----------------+----------------------------------------------------------------
             Age |  -.0734191   .0034808   -21.09   0.000    -.0802426   -.0665956
    FemaleGender |    .068608   .0064839    10.58   0.000     .0558977    .0813183
        Graduate |   .0756555    .007397    10.23   0.000     .0611553    .0901558
          Income |  -.0056442    .003613    -1.56   0.118    -.0127269    .0014384
  MinorityEthnic |    .004701   .0124505     0.38   0.706    -.0197058    .0291078
SocCulEmployment |    .028527   .0065054     4.39   0.000     .0157745    .0412794
           _cons |   1.289517   .0116168   111.00   0.000     1.266744    1.312289
----------------------------------------------------------------------------------

. eststo
(est5 stored)

. esttab

--------------------------------------------------------------------------------------------
                      (1)             (2)             (3)             (4)             (5)   
             SocJusValues    SocJusValues    SocJusValues    SocJusValues    SocJusValues   
--------------------------------------------------------------------------------------------
Age               -0.0573***      -0.0206**       -0.0430***      -0.0429***      -0.0734***
                 (-26.30)         (-3.13)        (-10.96)        (-10.97)        (-21.09)   

FemaleGender       0.0668***        0.139***       0.0605***       0.0644***       0.0686***
                  (17.38)         (10.00)         (10.80)         (10.18)         (10.58)   

Graduate           0.0738***       0.0735***       0.0640***       0.0641***       0.0757***
                  (18.56)         (18.49)         (11.30)         (11.33)         (10.23)   

Income           -0.00497*       -0.00546*       -0.00242        -0.00226        -0.00564   
                  (-2.29)         (-2.51)         (-0.73)         (-0.68)         (-1.56)   

MinorityEt~c       0.0448***       0.0454***       0.0785***       0.0785***      0.00470   
                   (6.09)          (6.16)          (5.33)          (5.34)          (0.38)   

SocCulEmpl~t       0.0335***       0.0337***       0.0260***       0.0259***       0.0285***
                   (8.57)          (8.61)          (4.59)          (4.57)          (4.39)   

AgeFemGenI~n                     -0.00142***                                                
                                  (-6.24)                                                   

Childless                                          0.0203***       0.0349                   
                                                   (3.35)          (1.83)                   

FemGenChil~n                                                     -0.00975                   
                                                                  (-0.85)                   

_cons               1.180***        1.191***        1.182***        1.176***        1.290***
                 (187.42)        (210.79)        (121.95)        (107.37)        (111.00)   
--------------------------------------------------------------------------------------------
N                   19616           19616            8690            8690            7076   
--------------------------------------------------------------------------------------------
t statistics in parentheses
* p<0.05, ** p<0.01, *** p<0.001

. 
. log close
      name:  <unnamed>
       log:  C:\Users\sbstjp\OneDrive - Cardiff University\FinalHarvard\Appendix2.8.log
  log type:  text
 closed on:  12 May 2025, 17:02:55
---------------------------------------------------------------------------------------------------------------
